package com.lu.teststuday;

/**
 * @author lufeng
 * @date 2021/9/3 15:36
 */

import java.util.Scanner;

//输入两个数 找出其中偶数
public class test3 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入求偶数的两个区间范围");
        int i = sc.nextInt();
        int j = sc.nextInt();
        print(i, j);
    }

    public static void print(int m, int n) {
        if (m == n) {
            System.out.println("请输入正确的区间");
        } else {
            int timemax = n > m ? n : m;
            int timemin = n < m ? n : m;
            for (int i = timemin; i <= timemax; i++) {
                if (i % 2 == 0) {
                    System.out.println("偶数为"+i);
                }
            }
        }
        }
    }



